/************************************************************************

								Heroes IV
					  Copyright 2000, The 3DO Company

	------------------------------------------------------------------
  						       mass_spell.h

	$Header: /game/mass_spell.h $

	$NoKeywords: $

 ************************************************************************/

#ifndef MASS_SPELL_H_INCLUDED
#define MASS_SPELL_H_INCLUDED

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#include "combat_spell.h"

// ----------------------------------------------------------------
// spell with multiple targets
// ----------------------------------------------------------------
class t_mass_spell_base : public t_combat_spell
{
public:
	t_mass_spell_base( t_battlefield& battlefield, t_spell spell );

	virtual bool					begin_casting();
	virtual void					execute( t_combat_creature& caster );
	virtual t_combat_ai_action_list generate_combat_ai_action_list(t_combat_ai &owner);
	virtual bool					spell_can_affect( t_combat_creature const& caster, 
													  t_combat_creature const& target ) const;
};

// ----------------------------------------------------------------
// spell with multiple targets
// ----------------------------------------------------------------
class t_mass_spell : public t_mass_spell_base
{
public:
	t_mass_spell( t_battlefield& battlefield, t_spell spell, t_spell base_spell );

	virtual	double			ai_weight( t_combat_creature const& target ) const;
	virtual bool			cast_on( t_combat_creature_ptr caster, 
		                             t_combat_creature_ptr target, 
									 int power,
									 bool is_mirror );
	virtual double			get_cancel_weight( t_combat_creature const& target ) const;
	virtual bool			spell_can_affect( t_combat_creature const& caster, 
											  t_combat_creature const& target ) const;
protected:
	t_spell			   m_base_spell;
	t_combat_spell_ptr m_spell_object;
};

#endif // MASS_SPELL_H_INCLUDED